package com.bajiao.app.controller.reserve;

import cn.hutool.core.util.StrUtil;
import com.bajiao.common.api.vo.RestResult;
import com.bajiao.service.reserve.ReserveService;
import com.bajiao.app.base.AppBaseController;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.*;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiImplicitParam;

import javax.annotation.Resource;

/**
 * @Description: 订座表
 * @Author: FanJq
 * @Date:   2025-01-13
 * @Version: V1.0
 */
@Slf4j
@Api(tags="订座表")
@RestController
@RequestMapping("/api/v1/reserve")
public class RestReserveController extends AppBaseController {

	@Resource
	private ReserveService reserveService;

	@PostMapping(value = "/arrange")
	@ApiOperation(value = "订座")
	@ApiImplicitParam(name = "storeId", value = "店铺id")
	public RestResult getAgreement(@ModelAttribute("userId") String userId,
											  @RequestParam("storeId") String storeId) {
		if (StrUtil.isBlank(userId))
			return tokenOverdue();
		reserveService.create(userId, storeId);
		return success();
	}


}
